package com.scujj.cs6.config;

import com.scujj.cs6.client.BaiduWeatherApiClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@Data
@ConfigurationProperties(prefix = "baidu.api")
public class BaiduApiConfig {
    private String accessKey;
    private String weatherApiUrl;

    @Bean
    public BaiduWeatherApiClient weatherClient() {
        return new BaiduWeatherApiClient(accessKey, weatherApiUrl);
    }
}
